<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
    <script type="text/javascript" src="./js/jquery.min.js"></script>
<title>文件上传</title>
</head>
<body>
<form>
<!-- 
method="post" action="${pageContext.request.contextPath}/addFile_submit" enctype="multipart/form-data"
 -->
		<div id="">
			<input type="file" name="fileName" id="fileName" value="" />
			<button  type="submit" style="height: 30px;width: 50px;" id="submittt">提交</button>
		</div>
</form>
</body>
<script>

 $(function(){
	$("#submittt").click(function(){
	  alert($("#fileName").val());
	  var url = "${pageContext.request.contextPath}/addFile_submit";
   	  var param = {fileName:$("#fileName").val()};//表单序列化传递到后台
   	  $.post(url, param, function(data) {
   		if(data.flag==1){
   			alert(data.msg);
   		}
   		if(data.flag==0){
   			alert(data.msg);
   		}
   	  });
	});
}) 

</script>
</html>